function [velocityfield]=cellTrackerMatPIV(phasefilenames)

matpivparams.res=[256 256; 128 128; 64 64; 32 32];
matpivparams.param2=1.0;
matpivparams.param3=0.75;
matpivparams.param4='multin';

N=length(phasefilenames);
velocityfield=cell(N-1,1);

%dirForSecondaryFiles=[oudir '\secondary'];

parfor i=1:N-1
%for i=1:N-1
    ['MATPIV loop: ' num2str(i) ' ' datestr(now)]
    
    
    FILE1 = phasefilenames{i};
    FILE2 = phasefilenames{i+1};
    
    
    
    %[x,y,u,v]=matpiv(FILE1,FILE2, [256 256; 128 128; 64 64; 32 32], 1.0, 0.75, 'multin');
    [x,y,u,v]=matpiv(FILE1,FILE2, matpivparams.res, matpivparams.param2, matpivparams.param3, matpivparams.param4);
    
    
    [gu,gv]=globfilt(x,y,u,v,3);
    
    [mu,mv]=localfilt(x,y,gu,gv,4,'median',4);
    
    [fu,fv]=naninterp(mu,mv,'linear');
    
    velocityfield{i}={x,y,u,v,fu,fv};
    
%     fileName=sprintf('%s%s_%05d%s',outdir,outPrefix,i,'.mat');
%     fid=fopen(fileName,'w');
%     fwrite(fid, fu, 'double');
%     fwrite(fid, fv, 'double');
%     fclose(fid);
    
    %save(fileName,fu,fv)
end